﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using LSBLL;
using LSEntity;
using LSInterFace;
using LSUtility;
using OralExamEntity;

namespace OralExamBLL
{
    public class OELoginBLL : ILoginBLL
    {
        public void AfterLoginDo(MemberEntity member)
        {
            if (member != null)
            {
                if (member.Type == LSEntity.MemberTypeEntity.Student)
                {
                    var list = TestBLL.TestGetClassGetList(member.MyClass.ClassId)
                                      .Where(m => m.TestingStatus == TestingStatus.TestIng)
                                      .ToList();
                    list.ForEach(m =>
                                 OECache<TestStepEntity>
                                     .TestStepSetCache(member,
                                                       m.TestId,
                                                       isLogin: true));
                }
            }
        }

        public void AfterLoginOffDo(MemberEntity member)
        {
        }
    }
}
